<include file="Public/newset-header" title="工单信息" />
<style>
.must-required{color:red;}
.ibox {
    clear: both;
    margin-bottom: 25px;
    margin-top: 0;
    padding: 0;
}
.ibox-title {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #ffffff;
    /* border-color: #e7eaec; */
    /* border-image: none; */
    /* border-style: solid solid none; */
    border-width: 4px 0 0;
    color: inherit;
    margin-bottom: 0;
    min-height: 48px;
    padding: 14px 15px 7px;
}
.ibox-content {
    clear: both;
}
.ibox-content {
    background-color: #ffffff;
    border-color: #e7eaec;
    border-image: none;
    border-style: solid solid none;
    border-width: 1px 0;
    color: inherit;
    padding: 15px 20px 20px;
}
.ibox-title h5 {
    display: inline-block;
    float: left;
    font-size: 16px;
    margin: 0 0 7px;
    padding: 0;
    text-overflow: ellipsis;
}
.hr-line-dashed {
    background-color: #ffffff;
    border-top: 1px dashed #e7eaec;
    color: #ffffff;
    height: 1px;
    margin: 20px 0;
}
.message-user, .message-kf {
    border-bottom: 1px dashed #bcbcbc;
    color: #999;
    margin-right: 55px;
    min-height: 80px;
    padding-right: 0;
}
/* .message-user, .message-kf {
    min-height: 120px;
} */
.message-user {
    margin-left: 55px;
    padding-top: 10px;
    text-align: left;
}

.message-avatar, .message {
    border: medium none;
    border-radius: 50%;
}
.avatar-user {
    float: left;
    margin-right: 10px;
}
.message-avatar {
    border: 1px solid #e7eaec;
    border-radius: 4px;
    height: 48px;
    margin-top: 1px;
    width: 48px;
}
.message-content {
    display: block;
    padding: 12px 0;
}
.message-date, .text-muted {
    font-size: 14px;
}
.message-date {
    color: #888888;
    font-size: 10px;
}
.chat-discussion .message-user .message-date {
    float: right;
}
.files img{width:50px;}
.recent{padding-top: 40px;}
@media (max-width:720px) {
    .message-user{margin-left: 0;}
    .message-user, .message-kf{margin-right: 0;}
}
</style>

<!--=== Content Part ===-->
<div class="container content recent">  
<div class="row">
    <div class="col-md-12 " style="display:none;">
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xm-12">
                <a class="btn-u" href="{:U('Index/index')}"><i class="fa fa-cloud-upload"></i> 上传新应用</a> &nbsp;&nbsp; </div>
               <div class="col-md-4 col-md-offset-2 col-sm-6 col-xm-12">
                </div>
            </div>
            <div class="margin-bottom-20"></div>
        </div> 
    </div>
    <div class="tab-v1 margin-bottom-20" style="display:none;">
        <ul class="nav nav-tabs">
            <li class="active"><a  href="javascript:void(0)">我的应用</a></li>
            <!--<li class=""><a href="mygroup.html">我的分组</a></li>-->
        </ul>                
    </div>

    <div class="row">
            <div class="col-md-12">

						<div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>工单信息</h5>
                                    <if condition="$info.status neq '2' "><a href="javascript:void(0)"  onclick="window.location.href='{:U('Member/close_ticket',array('id'=>$info['id']))}'" class="btn btn-primary" style="float:right;margin-top: -8px;"><i class="fa "></i>关闭工单</a></if>
                                                            </div>
                            <div class="ibox-content">
                                <div class="row">
                                    <div class="col-sm-12">
                                        <div class="row">
                                            <div class="col-md-3 text-center">
                                                工单标题                                            </div>
                                            <div class="col-md-7">
                                                {$info.desc}                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="row">
                                            <div class="col-md-3 text-center">
                                                提交时间                                            </div>
                                            <div class="col-md-7">
                                                {$info.addtime}                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="row">
                                            <div class="col-md-3 text-center">
                                                工单编号                                            </div>
                                            <div class="col-md-7">
                                                {$info.tno}                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="row">
                                            <div class="col-md-3 text-center">
                                                状态                                            </div>
                                            <div class="col-md-7">
                                                {$info.status|getTicketzt} 
                                            </div>
                                        </div>
										<div class="hr-line-dashed"></div>
                                        <div class="row">
                                            <div class="col-md-3 text-center">
                                                机密信息                                            </div>
                                            <div class="col-md-7">
                                                {$info.jimidesc}                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>


					<div class="row">
                        <div class="col-lg-12">
                            <div class="ibox chat-view">
                                <div class="ibox-title">
                                    <small class="pull-right text-muted">&nbsp;</small>
                                    沟通记录                                </div>
                                <div class="ibox-content">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="chat-discussion">
												<foreach name="list" item="v" key="k">
                                                <div class="message-user ">
                                                    <img alt="" src="/images/<if condition="$v.userid eq $fid ">pgyuser2.png<else/>pgykf.png</if>" class="message-avatar avatar-user">
                                                    <div class="message message-user"><if condition="$v.userid eq $fid ">我<else/>客服</if><span class="message-date"> {$v.addtime} </span>
                                                        <span class="message-content">{$v.desc}</span>
													</div>
                                                </div>
												</foreach>

											</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

			<if condition="$info.status neq '2' ">
           <div class="margin-bottom-20">
            <div class="panel pgy-panel-sea margin-bottom-40" id="tabbb">
                <div class="panel-heading pgy-panel-heading">
                  <h3 class="panel-title" style="color:#fff;min-height:34px;height:auto;">
                  <div class="row">
                  <div class="col-md-6 col-xs-12 col-sm-6 " style="margin-top:3px">
                    <i class="fa fa-angle-double-right"></i>我要反馈 &nbsp;
                   </div>
                    </div>
                   </h3>
                </div>

                <div class="tabbb_box" style="padding: 20px;">
                <form action="{:U('member/view_ticket')}" method="post">
					<input type="hidden" name="filenum" id="filenum" value="0">
					<input type="hidden" name="id" value="{$info.id}">
					<div class="form-group">
						<label><font class="must-required">*</font>留言</label>
						<textarea class="form-control" name="desc" placeholder="留言" rows="5" cols="20"></textarea>
					</div>
					<div class="form-group">
						<label>机密信息（非必填项）</label>
						<textarea class="form-control" name="jimidesc" placeholder="机密信息（非必填项）" rows="5" cols="20"></textarea>
					</div>

					<div class="form-group" style="display:none;">

							<div class="row">
								<div class="col-sm-12 filesList">
									<ul class="files">
									</ul>
								</div>
								<div class="col-sm-12">
									<span>附件大小不得超过<font class="notice">20</font>M。附件支持的格式有：'jpg', 'bmp', 'png', 'gif','txt','rar','zip','doc','docx','ini','conf','eml','pdf','xsl','xslx','ppt','pptx'</span><br/>
									<div class="hr-line-dashed"></div>
									<p><a href="javascript:void(0)" id="btnUpload" class="btn btn-w-m btn-primary">上传附件</a></p>
								</div>
							</div>

					</div>

					<div class="form-group">
						<button class="btn btn-success" type="submit" >提交</button>
					</div>


				</form>
                
                </div>
            </div>
            </div>

			</if>
        </div>
        <!--End Striped Rows-->
    </div>
    <div class="pager">{$page}
        </div>

</div><!--/container-->

<script language="javascript">

function deleteFile(key) {
	var filenum = $('#filenum').val();
	filenum--;

	$('#filenum').val(filenum);
	$('#' + key + '').remove();
}
function uploadFile() {
	$fub = $('#btnUpload');
	 if ($(".files li").length >= 3 ) {
		return false;
	 }

	var uploader = new qq.FineUploaderBasic({
		button: $fub[0],
		request: {
			endpoint: "{:U('index/uploadFile')}"
		},
		validation: {
			allowedExtensions: ['jpeg', 'jpg', 'gif', 'png', 'bmp', 'txt', 'rar', 'zip', 'doc', 'docx', 'ini', 'conf', 'eml','pdf','xsl','xslx','ppt','pptx']
		},
		maxConnections: 1,
		callbacks: {
			onSubmit: function(id, fileName) {
				this.setParams({'key': tKey});
			},
			onUpload: function(id, fileName) {
			},
			onProgress: function(id, fileName, loaded, total) {
			},
			onError: function(event, id, reason ) {
				alert(reason);
			},
			onComplete: function(id, fileName, responseJSON) {
				if (responseJSON.success) {
					$(".filesList").show();
					var html="";
					html = "<li fKey='" + responseJSON.key + "' id='" + responseJSON.key + "' fName='" + responseJSON.name + "'>";

					if (responseJSON.img) {
						html += "<img src='" + responseJSON.img + "'>";
					}
					var filenum = $('#filenum').val();
					filenum++;
					html += '<input type="hidden" name="filename_'+filenum+'" name="filename_'+filenum+'" value="'+responseJSON.name+'">';
					$('#filenum').val(filenum);
					html += responseJSON.name + ' <a href="javascript:void(0)" onclick="deleteFile(\'' + responseJSON.key + '\');">删除</a></li>';
					$('.files').append(html);

				}
			}
		},
		debug: true
	});
}


$(document).ready(function() {
	uploadFile(); 
});
</script>
<script src="__STATIC__/js/jquery.fineuploader.min.js"></script>
<include file="Public/newset-footer" />